<?php
	header("Content-type:text/xml; charset=utf-8");
	header("Cache-Control:no-cache");
	//数据库连接
	$conn = mysql_connect("115.28.175.114","liyifang","123456");
	mysql_select_db("company");
	mysql_query("set names utf8");
	if(!empty($_POST['provinceid'])){
		$provinceid = $_POST['provinceid'];
		$sql = "select * from pcc_city where fatherid ={$provinceid}";
		$query = mysql_query($sql);
		$info = "<province>";
		while($res = mysql_fetch_assoc($query)){
			$info .= "<city>";
			$info .= "<cityid>".$res['cityid']."</cityid>";
			$info .= "<city_name>".$res['city']."</city_name>";
			$info .= "</city>";
		}
		$info .= "</province>";
		echo $info;
	}
	
	
	if(!empty($_POST['cityid'])){
		
		$cityid = $_POST['cityid'];
		$sql = "select * from pcc_county where fatherid = {$cityid}";
		$query = mysql_query($sql);
		$info = "<city>";
		while($res = mysql_fetch_assoc($query)){
			$info .= "<county>";
			$info .= "<county_id>".$res['countyid']."</county_id>";
			$info .= "<county_name>".$res['county']."</county_name>";
			$info .= "</county>";
		}
		$info .= "</city>";
		echo $info;
	}
?>